import React from 'react';
import { connect } from 'react-redux';
import reducer, { getMessageList, deleteMsg } from '../../store/user/message';
import Message from '../../components/user/Message';
import { injectReducer } from '../../store/reducers';
import store from '../../store/createStore';

const mapStateToProps = state => ({
  list: state.message.list
});

const mapDispatchToProps = {
  getMessageList,
  deleteMsg
};
injectReducer(store, { key: 'message', reducer });
export default connect(
  mapStateToProps,
  mapDispatchToProps
)(Message);
